//二叉树的链式存储

#include <cstdlib>
#define ElemType char

typedef struct BiTNode
{
    ElemType data;                   //数据域
    struct BiTNode *lchild, *rchild; //左、右孩子指针
    int ltag = 0, rtag = 0;          //线索标志位(线索二叉树中才会使用，默认为零；当标志位为1时，表示对应指针域为线索)
    // struct BiTNode *parent;       //父节点指针(三叉链表中才会使用)
} BiTNode, *BiTree; // BiTree T; <=> BiTBode *T;

inline BiTNode *CreateBiTNode(char data) //新建二叉树结点
{
    BiTNode *N = (BiTNode *)malloc(sizeof(BiTNode));
    N->data = data;
    N->lchild = nullptr;
    N->rchild = nullptr;
    return N;
}

void InitT1(BiTree T) //图见ExampleTree1
{
    T->data = 'A';
    T->lchild = CreateBiTNode('B');
    T->rchild = CreateBiTNode('C');
    T->lchild->lchild = CreateBiTNode('D');
    T->lchild->rchild = CreateBiTNode('E');
    T->rchild->lchild = CreateBiTNode('F');
    T->lchild->lchild->rchild = CreateBiTNode('G');
    return;
}
